package com.yulongtian.oneProblemEveryDay.month202211.day20221129;

/**
 * https://leetcode.cn/problems/shuffle-string/@author yulongTian
 *  可
 * @create 2022-11-29 10:13
 */
public class Test02 {
    public static void main(String[] args) {

    }

    public static String restoreString(String s, int[] indices) {
        int len = s.length();
        char[] chs = new char[len];

        for (int i = 0; i < len; i++) {
            chs[indices[i]] = s.charAt(i);
        }
        StringBuilder res = new StringBuilder();
        for (char ch : chs) {
            res.append(ch);
        }
        return res.toString();
    }
}
